package com.leadingsoft.pwxk.converter;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

import com.leadingsoft.common.converter.AbstractConverter;
import com.leadingsoft.pwxk.dto.AuditPublicInfoDto;
import com.leadingsoft.pwxk.model.AuditPublicInfo;

@Component
public class AuditPublicInfoConverter extends AbstractConverter<AuditPublicInfo, AuditPublicInfoDto> {

	@Override
	protected AuditPublicInfoDto toDtoActual(AuditPublicInfo model) {
		AuditPublicInfoDto auditPublicInfoDto = new AuditPublicInfoDto();
		BeanUtils.copyProperties(model, auditPublicInfoDto);
		return auditPublicInfoDto;
	}

	@Override
	public void copyProperties(AuditPublicInfo model, AuditPublicInfoDto dto) {

	}

	public List<AuditPublicInfoDto> toListDto(List<AuditPublicInfo> list) {
		List<AuditPublicInfoDto> dtos = new ArrayList<AuditPublicInfoDto>();
		list.forEach(t -> {
			dtos.add(toDtoActual(t));
		});
		return dtos;
	}

}
